#pragma once

#include "tcservercore_global.h"
#include <QString>
#include "..\Type\User.h"

namespace TCServer
{
    namespace Store
    {
        class TCSERVERCORE_EXPORT UserTable
        {
        public:
			static void create();
			static quint64 insert(const Type::User &user);
            static Type::User query(const quint64 id);
            static void update(const Type::User &user);
            static void remove(const quint64 id);

			static bool UserTable::isUsernameExist(const QString &username);
			static bool UserTable::isEmailExist(const QString & email);
			static bool UserTable::isPhoneExist(const QString & phone);
            static std::tuple<bool, quint64> id(const QString & username_email_phone, const QString & passwordHash);
            static void flushLoginDatetime(const quint64 id);
            static bool isIdExist(quint64 userId);
        };
    }
}